package com.dao.impl;

import com.dao.UserInfoDao;
import com.pojo.OrderInfo;
import com.pojo.UserInfo;

import java.awt.print.Book;
import java.util.List;

public class UserInfoDaoImpl extends BaseDao implements UserInfoDao {

    @Override
    public UserInfo queryUserByUsernameAndPassword(String username, String password) {
        String sql = "select `UserId`,`UserName`,`Password` from userinfo where UserName = ? and Password = ?";
        return queryForOne(UserInfo.class, sql, username,password);
    }

    @Override
    public OrderInfo queryOrderInfoById(Integer id) {
        String sql = "select * from orderinfo where id = ?";
        return queryForOne(OrderInfo.class, sql, id);
    }

    @Override
    public int deleteOrderInfoById(Integer id) {
        String sql = "delete from orderinfo where id = ?";
        return update(sql, id);
    }

}
